package com.supermap.dataservice.temp.dao;

import com.supermap.dataservice.util.Table;
import com.supermap.dubbo.api.temp.entity.TempUserNM;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author:langhongshuai
 * @Description:内蒙临时大户信息数据访问层
 * @Date:18/8/10 上午11:01
 */
@Mapper
public interface TempUserNMDao {

    /**
     * 同期区域名获取内蒙所有大户用户临时表数据
     * @return
     */
    @Select("select * from t_temp_user_nm where if(isnull(#{areaname}),true,areaname=#{areaname}) limit #{table.startPoint},#{table.limit}")
    public List<TempUserNM> getUserInfoByAreaname(@Param("areaname")String areaname,@Param("table")Table table);

    /**
     * 通过区域名获取区域用户总数
     * @return
     */
    @Select("select count(*) count,areaname,longitude,latitude from t_temp_user_nm where if(isnull(#{areaname}),true,areaname=#{areaname}) group by areaname")
    public List<TempUserNM> getUserInfoCountByAreaname(@Param("areaname")String areaname);
}
